package com.ares.comparer.config.webMvc;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author: ares
 * @date: 2021/9/16 15:38
 * @description: webMvc
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Value("${comparePrefix}")
    private String comparePrefix;

    @Value("${compareLocation}")
    private String compareLocation;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(comparePrefix + "**").addResourceLocations("file:" + compareLocation);
    }

}
